package com.lexin.common.base;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

public class BaseController {
	/** 基于@ExceptionHandler异常处理 */ 
	@ExceptionHandler
	public ModelAndView exp (HttpServletRequest request, Exception ex) {
		request.setAttribute("ex", ex);
		ModelAndView mav = new ModelAndView();
		mav.addObject("ex", ex.getMessage());
		mav.setViewName("/error");
		return mav;
	}
	
}
